# @File    : yamlUtil.py
# @Project : Airtest_JBL
# YAML文件读取类
import os
import yaml


class YamlUtil:

    def __init__(self, filename):
        self.filename = filename
        self.path = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) + "\\" + "data" + "\\" + f'{filename}'

    def read_yaml(self):
        with open(self.path, mode="r", encoding="utf-8") as f:
            value = yaml.load(stream=f, Loader=yaml.FullLoader)
            return value
